package com.app.designpatternslearn.structured.filterpattern.code

class TypeFilterBook : FilterBook {

    override fun filter(books: MutableList<Book>): MutableList<Book> {

        val newBooks = mutableListOf<Book>()

        for(item in books) {
            //将计算机类目筛选出来
            if ("Computer55".equals(item.type, true)) {
                newBooks.add(item)
            }

        }
        return newBooks
    }

}